import React, { Component } from 'react'

import { WithStore } from './util'

class Footer extends Component {
    render() {
        const { data } = this.props
        let over = 0
        let notOver = 0

        for (const item of data) {
            if (item.checked) {
                over++
            } else {
                notOver++
            }
        }

        return (
            <li className={'list-item'} >
                <span>
                    待完成: {notOver}
                </span>
                <span style={{ textAlign: 'right' }} >
                    已完成: {over}
                </span>
            </li>
        )
    }
}

export default WithStore(Footer)